package com.pine.app.module.security.oauth.plugin;

import org.springframework.core.Ordered;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author xiaoyuan
 * @create 2020/3/6 22:27
 **/
public interface ProcessPlugin extends Ordered{


    /**
     * 前置处理操作
     * @param request
     * @param response
     */
    void prepare(HttpServletRequest request, HttpServletResponse response,Object o) throws ServletException, IOException;

    /**
     * 后置处理操作
     * @param request
     * @param response
     */

    void complete(HttpServletRequest request, HttpServletResponse response,Object o);

    void  exception(HttpServletRequest request, HttpServletResponse response,Exception e) throws ServletException, IOException;

     int getOrder();

     boolean isEnabled();

     void setEnabled(boolean enabled);


     boolean matcher(HttpServletRequest request,Plugin plugin);


}
